﻿'Digite o NameSpace: Babok
'Digite o nome da Classe de dominio: ItemBackLog

'--TESTE:-----------
'    <TestMethod()> _
'    Public Sub SalvarItemBackLog()
'        Dim _ItemBackLog As ItemBackLog
'        _ItemBackLog = New ItemBackLog
'
'        _ItemBackLog.Salvar()
'
'        Assert.IsTrue(_ItemBackLog.Id.HasValue)
'    End Sub
<Serializable()> _
Public Class ItemBackLog
    Inherits BaseDominio

    Private _titulo As String
    Public Overridable Property Titulo() As String
        Get
            Return _titulo
        End Get
        Set(ByVal value As String)
            _titulo = value
        End Set
    End Property


    Private _euComo As String
    Public Overridable Property EuComo() As String
        Get
            Return _euComo
        End Get
        Set(ByVal value As String)
            _euComo = value
        End Set
    End Property


    Private _quero As String
    Public Overridable Property Quero() As String
        Get
            Return _quero
        End Get
        Set(ByVal value As String)
            _quero = value
        End Set
    End Property


    Private _para As String
    Public Overridable Property Para() As String
        Get
            Return _para
        End Get
        Set(ByVal value As String)
            _para = value
        End Set
    End Property



    'Private _dataInicio As Nullable(Of Date)
    'Public Overridable Property DataInicio() As Nullable(Of Date)
    '    Get
    '        Return _dataInicio
    '    End Get
    '    Set(ByVal value As Nullable(Of Date))
    '        _dataInicio = value
    '    End Set
    'End Property

    'Private _dataFim As Nullable(Of DateTime)
    'Public Overridable Property DataFim() As Nullable(Of DateTime)
    '    Get
    '        Return _dataFim
    '    End Get
    '    Set(ByVal value As Nullable(Of DateTime))
    '        _dataFim = value
    '    End Set
    'End Property


    Private _requisitos As IList(Of Requisito)
    Public Overridable Property Requisitos() As IList(Of Requisito)
        Get
            Return _requisitos
        End Get
        Set(ByVal value As IList(Of Requisito))
            _requisitos = value
        End Set
    End Property

    Private _prioridade As Integer
    Public Overridable Property Prioridade() As Integer
        Get
            Return _prioridade
        End Get
        Set(ByVal value As Integer)
            _prioridade = value
        End Set
    End Property


#Region "Negocio"

    Public Sub New()
        MyBase.New()
        Me.Prioridade = 999
    End Sub

    Public Overridable Function Buscar(ByVal _id As Long) As ItemBackLog
        Return MyBase.ItemBackLogDao.Buscar(_id)
    End Function

    Public Overridable Sub Salvar()

        For Each _requisito In _requisitos
            _requisito.ItemBackLog = Me
        Next

        MyBase.ItemBackLogDao.Salvar(Me)
    End Sub

#End Region

End Class
